<template>
  <div class="number-container">
    <Counter
      class="counter"
      :number="parseInt(data.enterpriseNum)"
      :text="'企业注册'"
    />
    <Counter
      class="counter"
      :number="parseInt(data.signNum)"
      :text="'标识注册量'"
    />
    <Counter
      class="counter"
      :number="parseInt(data.signAnalysisNum)"
      :text="'标识解析量'"
    />
  </div>
</template>

<script>
import Counter from "./Counter.vue";
import axios from "axios";
import baseURL from "@/common/baseURL";
export default {
  data() {
    return {
      data: [],
    };
  },
  components: {
    Counter,
  },
  async created() {
    const resp = await this.getData();
    this.data = resp.data.data;
    // console.log(this.data);
  },
  methods: {
    async getData() {
      return await axios.get(baseURL + "/v1/public/analysisNumForOfficial");
    },
  },
};
</script>

<style lang="scss" scoped>
.number-container {
  width: 100%;
  height: 106px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  padding: 15px 0;
  .counter {
    border-right: 1px solid #bebdbd;
    &:last-child {
      border: none;
    }
  }
}
</style>
